package cn.edu.dgut.css.springboottestthree.service;

import cn.edu.dgut.css.springboottestthree.dao.RegionDao;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.io.IOException;

/**
 * @date: 2020/11/19 12:04
 * @author: ZkhEight
 */
@Service
public class FetchDataService {

    @Resource
    private RegionDao regionDao;


    @Scheduled(cron = "${region.cron}")
    public void fetchData() throws IOException {
        regionDao.getData();
    }

}
